<template>
	<view class="imageText">
		图文企鹅不过你九七二杠i哦
		{{labelInfo.data.name}}
		
		<view class="img1">
			<image src="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-016e8c49-b0c2-45f6-9dd8-3cd6911c0112/90da15e9-3f32-44e6-8a7a-3bc3c669cc38.jpg" mode=""></image>
		</view>
		<view>
			<button type="default" @click="btnImg">上传图片</button>
			<image :src="img1" mode="" style="width: 100px;"></image>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				img1:''
			}
		},
		props:{
			labelInfo:{
				type:Object,
				default:{}
			}
		},
		mounted() {
			console.log("图文父传子");
			console.log(this.labelInfo);
		},
		methods:{
			btnImg(){
				//选择图片
				uni.chooseImage({
					count:1,
					success: (res) => {
						const tempFilePath = res.tempFilePaths[0]
						console.log(tempFilePath);
						//将选择后的图片上传到云存储里面
						uniCloud.uploadFile({
							//图片路径
							filePath:tempFilePath,
							//图片名称
							cloudPath:"星辰大海",
							success: (res) => {
								console.log(res);
								this.img1=res.filePath;
							},
							fail: (err) => {
								console.log(err);
							}
						})
					},
					fail: (err) => {
						console.log(err);
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
.img1{
	height: 250rpx;
	width: 250rpx;
	border-radius: 50%;
	overflow: hidden;
}
</style>
